import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        meta: {
            title: '登录'
        },
        component: () => import("@/views/login")
    },
    {
        path: '/main',
        name: 'mainPage',
        redirect: '/map',
        component: () => import('../views/mainPage'),
        children: [
            {
                path: '/map',
                name: 'leafletMap',
                meta: {
                    title: '数据中台'
                },
                component: () => import("../components/leafletMap")
            },
            {
                path: '/history',
                name: 'history',
                meta: {
                    title: '历史数据'
                },
                component: () => import("../components/history")
            },
            {
                path: '/CR',
                name: 'CR',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/CR")
            },
            {
                path: '/ET',
                name: 'ET',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/ET")
            },
            {
                path: '/KDP',
                name: 'KDP',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/KDP")
            },
            {
                path: '/PHI',
                name: 'PHI',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/PHI")
            },
            {
                path: '/REF',
                name: 'REF',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/REF")
            },
            {
                path: '/RHO',
                name: 'RHO',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/RHO")
            },
            {
                path: '/TREF',
                name: 'TREF',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/TREF")
            },
            // {
            //     path: '/VIL',
            //     name: 'VIL',
            //     component: () => import("../components/products/VIL")
            // },
            {
                path: '/ZDR',
                name: 'ZDR',
                meta: {
                    title: '雷达产品'
                },
                component: () => import("../components/products/ZDR")
            }, {
                path: '/EC',
                name: 'ensemble',
                meta: {
                    title: '模式预报'
                },
                component: () => import("../components/ensemble")
            }, {
                path: '/stationData',
                name: 'stationData',
                meta: {
                    title: '站点数据'
                },
                component: () => import("../components/stationData")
            }

        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
